Skip to content

Super-imposed plots card width#56

Merged
Demonstrandum merged 3 commits into
masterfrom
cursor/super-imposed-plots-card-width-9016
Feb 19, 2026
Merged

Super-imposed plots card width#56
Demonstrandum merged 3 commits into
masterfrom
cursor/super-imposed-plots-card-width-9016

Conversation

@Demonstrandum

Copy link
Copy Markdown
Owner

Motivation for features / changes

Fixes #55. Superimposed plots previously ignored the "card width" setting because their grid column width was hardcoded in SCSS, unlike regular card grids which dynamically apply the setting via a style binding.

Technical description of changes

  1. superimposed_cards_view_component.ts:
    • Added a cardMinWidth @Input().
    • Implemented ngOnChanges to compute the gridTemplateColumn style string based on the cardMinWidth input, including validation to ensure the width is within the allowed range (335px to 735px).
    • Added a [style.grid-template-columns]="gridTemplateColumn" binding to the grid div in the template, allowing the dynamic width to override the default SCSS.
  2. superimposed_cards_view_container.ts:
    • Selected getMetricsCardMinWidth from the NgRx store.
    • Passed the selected cardMinWidth value as an input to the SuperimposedCardsViewComponent.

Screenshots of UI changes (or N/A)

N/A

Detailed steps to verify changes work correctly (as executed by you)

  1. Navigate to a TensorBoard experiment with scalar data.
  2. Create a superimposed plot (e.g., by selecting multiple runs and viewing scalar plots).
  3. Go to the settings panel (gear icon).
  4. Adjust the "Card Width" slider.
  5. Observe that the width of the cards within the superimposed plot now changes dynamically according to the setting.

Alternate designs / implementations considered (or N/A)

N/A


Open in Cursor Open in Web

The superimposed cards grid had its column width hardcoded via a SCSS
variable ($metrics-min-card-width: 335px) and never read the dynamic
cardMinWidth setting from the store.

Regular card grids (CardGridComponent) receive cardMinWidth as an input
and apply it via [style.grid-template-columns], which overrides the
SCSS default. Superimposed cards were missing this entirely.

Changes:
- SuperimposedCardsViewContainer: select getMetricsCardMinWidth from the
  store and pass it as [cardMinWidth] to the presentation component.
- SuperimposedCardsViewComponent: accept cardMinWidth input, compute
  gridTemplateColumn in ngOnChanges (same logic as CardGridComponent),
  and bind it via [style.grid-template-columns] on the grid div.

Fixes #55

Co-authored-by: Samuel <samuel@knutsen.co>
@cursor

cursor Bot commented Feb 19, 2026

Copy link
Copy Markdown

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@Demonstrandum Demonstrandum marked this pull request as ready for review February 19, 2026 13:14
@github-actions

github-actions Bot commented Feb 19, 2026

Copy link
Copy Markdown

Preview Deployment

Status ✅ Running
Live Preview https://Demonstrandum-tensorbored-pr-56.hf.space
Space https://huggingface.co/spaces/Demonstrandum/tensorbored-pr-56
Details
  • Wheel: tensorbored_nightly-2.21.0a20260219-py3-none-any.whl
  • Commit: 03afb00
  • Build status: success

cursoragent and others added 2 commits February 19, 2026 13:58
When a line chart has disableUpdate=true (card not yet visible via
intersection observer), the container may be resized by persistResize
restoring a saved height, or by a full-width class being applied
asynchronously from the store.  The ResizeDetectorDirective's skip(1)
can batch this resize with the initial ResizeObserver event, causing
the only notification to be swallowed.  The chart then holds stale
dimensions from ngAfterViewInit, so the renderer draws curves at one
scale while the interactive overlay positions tooltip dots at another.

Fix: when disableUpdate transitions from true to false, re-read the
DOM dimensions and resize the chart renderer so both the canvas and
the coordinate mapping match the current layout.

Co-authored-by: Samuel <samuel@knutsen.co>
Co-authored-by: Samuel <samuel@knutsen.co>
@Demonstrandum Demonstrandum merged commit 3537982 into master Feb 19, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

super-imposed plots ignore the "card width" setting

2 participants